<?php
/**
 * 异常订单
 * (model)
 */

namespace App\Models\CustomerDelivery;


use Illuminate\Database\Eloquent\Model;

class CustomerOrderException extends Model{

    protected $table = 'customer_order_exception';

    protected $guarded  = [];

    public $timestamps = false;

    /**
     * 同步状态
     * @var string[]
     */
    const SYNC_NO  = 1; //未同步
    const SYNC_YES = 2; //已同步
    public static $_status = [
        self::SYNC_NO  => '未同步',
        self::SYNC_YES => '已同步',
    ];

    /**
     * @param $platId
     * @param $orderNo
     * @param $sellerSku
     * @return \Illuminate\Database\Eloquent\Builder|Model|object|null
     */
    public static function getOrderException($platId, $orderNo, $sellerSku){
        return self::query()
            ->where('plat_id', $platId)
            ->where('order_no', $orderNo)
            ->where('seller_sku', $sellerSku)
            ->first();
    }

}
